using System;
using System.Xml;
using System.Xml.Serialization;

namespace MCMLXVII.BackEnd.Services.Common.Messages
{
	/// <summary>
	/// This class is a generic document for transport XML responses or Request
	/// This class supports serialization and is for the exchange of xml documents over remoting 
	/// is smaller than the XML Document
	/// </summary>
	[Serializable()]
    [System.Xml.Serialization.XmlType(Namespace = "http://tempuri.org/")]
	public class msgXMLResponse
	{
		private string _Document="";
		public msgXMLResponse()
		{
		}
        public msgXMLResponse(XmlDocument xdoc)
        {
            _Document = xdoc.OuterXml;
        }
        public msgXMLResponse(string DocumentXML)
        {
            _Document = DocumentXML ;
        }
        public msgXMLResponse(XmlReader xdocReader)
        {
            XmlDocument xdoc = new XmlDocument();
            xdoc.Load(xdocReader);
            _Document = xdoc.OuterXml;
        }

        public XmlDocument Document
		{
            get
            {
                XmlDocument xdoc = new XmlDocument();
                xdoc.LoadXml(_Document);
                return xdoc;}
            set { _Document = value.OuterXml;}
        }

        public string DocumentXML
        {
            get
            { return _Document;}
        }

        public override string ToString()
		{
			return _Document;
		}

    }
}
